home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
BORLAND TURBO
/
CLASSINC.PAK
/
TIMER.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-05
|
1KB
|
90 lines
//----------------------------------------------------------------------------
// Borland Class Library
// Copyright (c) 1991, 1997 by Borland International, All Rights Reserved
//
//$Revision: 5.6 $
//
//----------------------------------------------------------------------------
#if !defined(CLASSLIB_TIMER_H)
#define CLASSLIB_TIMER_H
#include <classlib/defs.h>
#if !defined(BI_PLAT_DOS) && !defined(BUILDBIDSTIMER)
# error class TTimer only available under DOS
#endif
#pragma option -Vo-
#if defined( BI_CLASSLIB_NO_po )
# pragma option -po-
#endif
#if defined(BI_NAMESPACE)
namespace ClassLib {
#endif
class TTimer
{
public:
TTimer();
void Start();
void Stop();
void Reset();
int Status();
double Time();
static double Resolution();
private:
static unsigned Adjust;
static unsigned Calibrate();
int Running;
struct TIME
{
unsigned long DosCount;
unsigned TimerCount;
};
TIME StartTime;
double Time_;
};
#if defined( BI_OLDNAMES )
#define Timer TTimer
#endif
inline int TTimer::Status()
{
return Running;
}
inline double TTimer::Time()
{
return Time_/1.E6;
}
inline double TTimer::Resolution()
{
return 839/1.E9;
}
#if defined(BI_NAMESPACE)
} // namespace ClassLib
#endif
#if defined( BI_CLASSLIB_NO_po )
#pragma option -po.
#endif
#pragma option -Vo.
#endif // CLASSLIB_TIMER_H